package com.scs.application.modules.dept.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 * 科室消耗单主表
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@TableName("dept_use")
@EntityClassAnnotation(remark = "科室消耗表")
@EntityIndexAnnotation(ux = {"use_key"},ix = {"flow_status","flow_modified"})
public class Use extends FlowEntity {

    @EntityFieldAnnotation(
            text = "参考类型",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refType;

    @EntityFieldAnnotation(
            text = "参考ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "来源单据ID"
    )
    private String refId;

    @EntityFieldAnnotation(
            text = "参考单号",
            length = "20",
            not_null = false,
            default_value = "",
            comment = "来源单据标识"
    )
    private String refKey;

    @EntityFieldAnnotation(
            text = "关联表",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refTable;

    @EntityFieldAnnotation(
            text = "是否冲红消耗单0:否 1：是",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Integer flagUseRedType;

    @EntityFieldAnnotation(
            text = "单据类型",
            length = "10",
            not_null = false,
            default_value = "",
            comment = "MANUAL：手工确认消耗（科室手工登记）；CABINET：智能柜确认消耗； DIST : 配送出库； RETURN： 科室退库"
    )
    private String useType;

    @EntityFieldAnnotation(
            text = "单据标识",
            length = "20",
            not_null = false,
            default_value = "",
            comment = "单据标识"
    )
    private String useKey;

    @EntityFieldAnnotation(
            text = "单据日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = "单据日期"
    )
    private Date useDate;

    @EntityFieldAnnotation(
            text = "库存地ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "库存地ID"
    )
    private String warehouseId;

    @EntityFieldAnnotation(
            text = "库存地全称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "库存地全称"
    )
    private String warehouseName;

    @EntityFieldAnnotation(
            text = "科室ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "科室ID"
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "科室名称",
            length = "30",
            not_null = false,
            default_value = "",
            comment = " "
    )
    private String deptName;

    @EntityFieldAnnotation(
            text = "金额",
            length = "",
            not_null = false,
            default_value = "",
            comment = "金额"
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "手术单ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String oprtId;

    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "备注"
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "操作人",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "备注"
    )
    private String userName;

    @TableField(exist = false)
    private String mergeId;

    @EntityFieldAnnotation(
            text = "库位id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String locationId;

    @EntityFieldAnnotation(
            text = "库位名称",
            length = "50",
            not_null = false,
            default_value = "",
            comment = "货位名称"
    )
    private String locationName;

    @EntityFieldAnnotation(
            text = "序列号",
            length = "10",
            not_null = false,
            comment = "业务审核之后的序列号，打印对单使用"
    )
    private Integer snum;

    @EntityFieldAnnotation(
            text = "试剂组id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = ""
    )
    private String reagentTeamId;

    // 试剂组名称
    @TableField(exist = false)
    private String reagentTeamName;


    // 明细数量
    @TableField(exist = false)
    private int countDtl;

}
